﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace VikingArcade_v2._0
{
    public abstract class UserInterfaceControlDrawer : IDrawer
    {
        private UserInterfaceControl control;

        public UserInterfaceControlDrawer(UserInterfaceControl control)
        {
            this.control = control;
        }

        #region IDrawer Members

        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (control.Visible)
            {
                foreach (UserInterfaceControl child in control.Children)
                {
                    child.GetDrawer().Draw(spriteBatch);
                }
            }
        }

        #endregion
    }
}
